//========encoding:utf-8=========
/*
 * @describe:  三目运算符
 * @author:mhao
 * @copyright:chinasoft.cn
 * @date:2020年3月17日   下午10:08:34
 */
package edu.chinasoft.handle;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.servlet.ModelAndView;

@Controller(value="handler01")
public class Handler01 {
private Logger logger = LoggerFactory.getLogger(Handler01.class);
	public void method01(HttpServletRequest request,HttpServletResponse response,HttpSession session) {
		// TODO Auto-generated method stub
		logger.info("Handler01>>>method01 start ……");
		logger.info("request对象:"+request);
		logger.info("response对象:"+response);
		logger.info("session对象:"+session);
		logger.info("Handler01>>>method01 end ……");
	}
	//自动传值
	@RequestMapping(value="/method02.do")
	public void method02(ModelAndView modelAndView,ModelMap modelMap,Model model,Map map) {
		// TODO Auto-generated method stub
		logger.info("Handler01>>>method02 start ……");
		logger.info("modelAndView对象:"+modelAndView);
		logger.info("modelMap对象:"+modelMap);
		logger.info("model对象:"+model);
		logger.info("map对象:"+map);
		logger.info("Handler01>>>method02 end ……");
	}
	//八大基本类型
	@RequestMapping("/method03.do")
	public ModelAndView method03(ModelAndView modelAndView,@RequestParam(value="p3") int p1,@RequestParam(value="p4") boolean p2) {
		logger.info("Handler01>>>method03 start ……");
		modelAndView.addObject("key01", p1);
		modelAndView.addObject("key02", p2);
		modelAndView.setViewName("/loginsuccess.jsp");
		logger.info("Handler01>>>method03 end ……");
		return modelAndView;
	}
	//八大基本类型的包装类
	@RequestMapping("/method04.do")
	public ModelAndView method04(ModelAndView modelAndView,Integer p1,Boolean p2) {
		logger.info("Handler01>>>method04 start ……");
		modelAndView.addObject("key01", p1);
		modelAndView.addObject("key02", p2);
		modelAndView.setViewName("/loginsuccess.jsp");
		logger.info("Handler01>>>method04 end ……");
		return modelAndView;
	}
	//字符串类型
	@RequestMapping("/method05.do")
	public ModelAndView method05(ModelAndView modelAndView,String p1) {
		logger.info("Handler01>>>method05 start ……");
		modelAndView.addObject("key01", p1);
		modelAndView.setViewName("/loginsuccess.jsp");
		logger.info("Handler01>>>method05 end ……");
		return modelAndView;
	}
}
